#ifndef FZUIJIN_H
#define FZUIJIN_H

#include <QWidget>
#include <form11.h>
#include <QWidget>
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QJsonObject>
#include <QJsonValue>
#include <QJsonArray>
#include <QMainWindow>
#include <QTableWidgetItem>
#include <QMediaPlayer>
#include <QAudioOutput>
#include <QSqlDatabase>
#include <QSqlQuery>
#include <QSqlError>

namespace Ui {
class Fzuijin;
}

struct musicInfo1
{
    musicInfo1() {}
    int id;//歌曲ID
    QString musicName;//歌名
    QString albumName;//专辑名
    QStringList artists;//歌手
    unsigned long duration;//时长
};
class Fzuijin : public QWidget
{
    Q_OBJECT

public:
    explicit Fzuijin(QWidget *parent = nullptr);
    ~Fzuijin();
    QVector<musicInfo1> vInfo;
    QNetworkAccessManager * manager;
    QMediaPlayer * player;
    QAudioOutput * audioOutput;
    int playIndex;//当前播放的歌曲的下标


  void addSongToHistory(int songIndex); // 添加新方法来添加歌曲到历史记录

    void loadSongsFromDatabase();
private:
    Ui::Fzuijin *ui;
     QList<int> playedSongsHistory; // 存储播放过的歌曲索引
    //QNetworkReply *reply; // 假设这是一个网络请求的回复
};

#endif // FZUIJIN_H
